package com.wkbb.common.enums;

/**
 * 请假类型枚举
 */
public enum LeaveTypeEnum {
    LEAVE_TYPE_YEARLY((short)1, "年假"),
    LEAVE_TYPE_AFFAIR((short)2, "事假"),
    LEAVE_TYPE_SICK((short)3, "病假"),
    LEAVE_TYPE_REST((short)4, "调休"),
    LEAVE_TYPE_MARRY((short)5, "婚假"),
    LEAVE_TYPE_GIVE_BIRTH((short)6, "产假"),
    LEAVE_TYPE_ACCOMPANY((short)7, "陪产假"),
    LEAVE_TYPE_FUNERAL((short)8, "丧假");

    private short code;
    private String desc;

    LeaveTypeEnum(short code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 普通方法
    public static String getDesc(short code) {
        for (LeaveTypeEnum c : LeaveTypeEnum.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public short getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
